<div class="SipeiInfo border_3 pt20 pb15 centered back_bgf"><!--选修课等级分数设置-弹窗-新增-->
         <?php //new CActiveForm();
$form = $this->beginWidget('CActiveForm', array(
'action' => Yii::app()->createUrl('/problem/rules/editrulesdetail'),
'method' => 'POST',
'id' => 'searchForm',
'htmlOptions'=>array('target'=>'ajax-frame')
));
    ?>
        <?php
        $id = '';
        $name = '';
        $out_name = '';
        $value = '';
        $number = '';
        if ($problemruledetail) {
        	$id = $problemruledetail['id'];
        	$name = $problemruledetail['name'];
        	$number = $problemruledetail['number'];
        	$out_name = $problemruledetail['out_name'];
        	$value = $problemruledetail['value'];
        }
        ?>
        <table class="fontc_666 height32">
            <tbody>
               <tr height="55">
                    <td valign="top" align="right" width="120" class="pr5"><span class="pr5 fontc_orange_red">*</span>序号：</td>
                    <td valign="top" width="348" class="formValidator_td">
                        <input type="text" value="<?php echo $number; ?>" name="number" id='number' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" />
                        <div class="formValidator_tip">
                            <p id="numberTip" ></p>
                        </div>
                    </td>
                </tr>
               <tr height="55">                
                    <td valign="top" align="right" width="120" class="pr5">
                    	<span class="pr5 fontc_orange_red">*</span>导出栏位名称：
                    	<input type="hidden" name="id" value='<?php echo $id; ?>'>
                    	<input type="hidden" name="pb_id" value='<?php echo $pb_id; ?>'>
                    </td>
                    <td valign="top" width="348" class="formValidator_td">
                        <input type="text" value="<?php echo $name; ?>" name="name" id='name' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" />
                        <div class="formValidator_tip">
                            <p id="nameTip" ></p>
                        </div>
                    </td>
                </tr>
               <tr>
                    <td align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>导出数据：</td>
                    <td class="formValidator_td">
                        <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3">
                            <span class="fl select_shelter">
                                <select name="out_name" class="fl fontc_666" onchange="checkrow(this.value)">
                            	<?php foreach ($tableinfo as $k=>$v):?>
                           		<option value="<?php echo $v['COLUMN_NAME'];?>" <?php if ($out_name==$v['COLUMN_NAME']) echo "selected='selected'"?>><?php echo $v['COMMENTS'];?></option>
                           		<?php endforeach;?>
                           		<option value="gdz" <?php if($out_name=='gdz'):?>selected<?php endif;?>>固定值</option>
							</select>
                            </span>
                        </span>
                    </td>
                </tr>
                <tr id="gdz" <?php if ($value ==''):?>style="display:none;"<?php endif;?>>
                    <td align="right" valign="top" class="pt20 pr5">固定值：</td>
                    <td valign="top" class="pt20 formValidator_td">
                        <input type="text" value="<?php echo $value; ?>" name="value" id='value' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="pt20 pr5 pb15"></td>
                    <td class="pt20 pb15"><input type="submit" value="保存" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor mr10" />
                        <input type="button" onclick="api.close();" value="取消" class="b_a_n border_3 back_bgb w80 height32 fontc_FFF fonts_12 cursor" />
                    </td>
                </tr>
            </tbody>
        </table>
       <?php
       $this->endWidget();
    ?>
</div>
<iframe src='' style="display:none" name='ajax-frame'></iframe>
<script>
$(function(){
	$.formValidator.initConfig({formID:"searchForm",theme:"126",submitOnce:false,
	onError:function(msg,obj,errorlist){
		$("#errorlist").empty();
		$.map(errorlist,function(msg){
			$("#errorlist").append("<li>" + msg + "</li>")
		});
		alert(msg);
	},
	ajaxPrompt : '有数据正在异步验证，请稍等...'
	});

	/*栏位名称验证*/
	$("#name").formValidator({
		onShowText:"请输入导出栏位名称",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min:1,
		max:20,
		onError:"导出栏位名称长度在1-20之间(1到10个汉字)"
	});
	$("#number").formValidator({
		onShowText:"请输入序号",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min:1,
		onError:"请输入序号长度最少一位"
	}).regexValidator({
		regExp: "intege1",
		dataType: "enum",
		onError: "序号位数必须是正整数"
	});

})
function checkrow(val){
	if(val=='gdz'){
		$("#gdz").show();
	}else{
		$("#gdz").hide();
	}
}
</script>
<?php exit; ?>